<template>
  <Row class="lesson-view" type="flex">
    <Col span="4" class="side">
      <Menu class="h-100" mode="vertical" width="auto">
        <AutoMenu :data="items"></AutoMenu>
      </Menu>
    </Col>
    <Col span="20" offset="4">
      <div class="header">
        <h1 class="title">线性导论</h1>
        <hr class="split">
      </div>
      <router-view></router-view>
    </Col>
  </Row>
</template>

<script>
import AutoMenu from '@/components/widgets/AutoMenu'

export default {
  name: 'LessonView',
  components: {'AutoMenu': AutoMenu},
  data () {
    return {
      items: [
        {
          title: '序言'
        },
        {
          title: '线性导论',
          children: [
            {title: '线性概述'},
            {title: '线性袋鼠'},
            {
              title: '青蛙',
              children: [
                {title: '1'},
                {title: '2'},
                {title: '3'}
              ]
            }
          ]
        }
      ]
    }
  }
}
</script>

<style scoped>
.lesson-view {
  position: absolute;
  width: 100%;
}

.h-100 {
  height: 100%;
}

.side {
  top: 4rem;
  bottom: 0;
  position: fixed;
  overflow-y: auto;
}

.title {
  font-weight: bold;
  font-size: 1.5rem;
  padding: 1rem;
  float: left;
}

.split {
  border: none;
  border-bottom: 1px solid #dddee1;
  clear: both;
}

.header {
  overflow: hidden;
  /*position: absolute;*/
  left: 0;
  right: 0;
  top: 0;
}
</style>
